import { adminConfig } from "@Tea/model"
import { removeLocalStorage } from "@Tea/utils"
import  router  from "@/router/permission"

export const useLoginOut = () => {
  const clearList = ['user', 'targetRoute', 'routeTree']
  
  clearList.forEach((code) => {
    removeLocalStorage(`${adminConfig.systemCode}-${code}`)
  })
  
  router.replace({ name: "login" })
}